﻿<UserControl x:Class="CAION2.Controls.EnhantStigmaPlace"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:CAION2.Controls"
             xmlns:viewModels="clr-namespace:CAION2.ViewModels"
             x:Name="Control"
             Width="42"
             Height="42"
             Background="Transparent"
             Opacity="{Binding EnhantOpacity}"
             IsEnabled="{Binding IsEnabled}"
             ToolTipService.ShowDuration="36000">

    <UserControl.DataContext>
        <viewModels:StigmaPlaceViewModel />
    </UserControl.DataContext>

    <UserControl.Style>
        <Style TargetType="{x:Type controls:EnhantStigmaPlace}">
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="BorderBrush" Value="{DynamicResource Accent}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>

    <UserControl.ToolTip>
        <ToolTip>
            <controls:StigmaToolTip DataContext="{Binding ToolTipData, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
        </ToolTip>
    </UserControl.ToolTip>

    <Canvas Width="{Binding Width, ElementName=Control}"
            Height="{Binding Height, ElementName=Control}"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch">

        <Image Width="40"
               Height="40"
               Margin="1,1,0,0"
               Panel.ZIndex="1"
               Source="{Binding Icon,
                                Mode=OneWay,
                                UpdateSourceTrigger=PropertyChanged}"
               Stretch="Uniform" />

        <Border Width="40"
                Height="40"
                Margin="1,1,0,0"
                Panel.ZIndex="4"
                Background="{Binding RedBackground,
                                     Mode=OneWay,
                                     UpdateSourceTrigger=PropertyChanged}" />

        <Border Width="42"
                Height="42"
                Panel.ZIndex="7"
                BorderBrush="{Binding BorderBrush,
                                          ElementName=Control,
                                          Mode=OneWay}"
                BorderThickness="2" />
    </Canvas>
</UserControl>